<?php
/**
 * @Author: Marte
 * @Date:   2017-08-14 11:13:31
 * @Last Modified by:   Marte
 * @Last Modified time: 2017-08-18 21:46:18
 */


session_start();
header('Content-Type:text/html;charset=utf-8');
include "../config_connect.php";//导入数据库
if(isset($_GET['action']))
{
    $_receive=$_POST['hide'];
    $_senduser=$_SESSION['username'];
    $_content=$_POST['content'];
    echo "正在跳转中...请稍等";
   //获取表单内容，加入数据库
   $sql1 = "INSERT INTO comment (receive,send,content,time) VALUES ('$_receive', '$_senduser', '$_content',now())";
    if($_mysql->query($sql1) == TRUE)
    {
        $_mysql->close();
        echo "<script>window.history.back();</script>";
    }
    else
    {
        echo 'fail'.$_mysql->error;

    }

}
?>
